package com.zzyl.nursing.controller.memer;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.domain.PageResult;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author 19684
 */
@RestController
@RequestMapping("/member/orders/project")
@Slf4j
@Api(tags = "小程序端护理项目")
public class MemberProjectController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;


    /*    @GetMapping("/page")
        @ApiOperation("分页查询护理项目列表")
        public TableDataInfo<List<NursingProject>> page(NursingProject nursingProject) {
            startPage();
            List<NursingProject> list = nursingProjectService.list();
            return getDataTable(list);
        }*/
    @GetMapping("/page")
    @ApiOperation("分页查询护理项目列表")
    public AjaxResult page(
            String name,
            Integer status,
            Integer pageNum,
            Integer pageSize
    ) {
        return nursingProjectService.getPage(name, status, pageNum, pageSize);
    }

    @GetMapping(value = "/{id}")
    @ApiOperation("获取护理项目详细信息")
    public R<NursingProject> getInfo(@ApiParam(value = "护理项目ID", required = true)
                                     @PathVariable("id") Long id) {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}
